import javax.swing.*;

public class ErrorMessageDialog extends JFrame {
	private JLabel label;
	public ErrorMessageDialog(String error)
	{
		super( "Error" );   
		JPanel panel = new JPanel();
		panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
		
		label = new JLabel(error);
		label.setAlignmentX(CENTER_ALIGNMENT);
		panel.add(label);
		
		getContentPane().add(panel);
		setSize( 300, 200 );
		setVisible(true);
	}
}
